<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>网站后台管理</title>
<link href="__PUBLIC__/Admin/images/Admin_css.css" type="text/css" rel="stylesheet">
<link rel="shortcut icon" href="__PUBLIC__/Admin/images/myfav.ico" type="image/x-icon" />
<import file= "Admin.js.admin,Admin.js.Ajax,Admin.js.Jquery"/> 
<script charset="utf-8" src="__PUBLIC__/Common/artDialog/jquery.artDialog.js?skin=green"></script>
<script charset="utf-8" src="__PUBLIC__/Common/artDialog/extend.js"></script>
<script>
function jconfirm(str,url)
{
   $.dialog.confirm(str,function (){window.location.href=url;});
}
function alertcheck()
{
	if(checkselectId()==false)
	{
		$.dialog.alert('请勾选ID记录!');
	}
}
function checkselectId()
{
	var ch =  $('.ids');
	var input = '';
	for(var i=0; i<ch.length;i++)
	{
		if(ch[i].checked == true)
		{
			input += ch[i].value+',';
		}       
	}
	if(input=='') return false;
	return input;
}

function singleaudit(id)
{
	var values = {'1':'正常浏览','2':'会员浏览','3':'付费浏览','4':'禁止浏览','8':'删除至回收站','99':'彻底删除'};
	var input = id +',';
	var url = '{:U('Archive/ajax?method=audit')}';
	$.dialog.select('请选择审核操作',function(){},input,values,url);
}
function audit()
{
	var values = {'1':'正常浏览','2':'会员浏览','3':'付费浏览','4':'禁止浏览','8':'删除至回收站','99':'彻底删除'};
	if(checkselectId())
	{
		var input = checkselectId();
	}
	else
	{
		$.dialog.alert('请勾选ID记录!'); return false;
	}
	var url = '{:U('Archive/ajax?method=audit')}';
	$.dialog.select('请选择审核操作',function(){},input,values,url);
}
function flag(method)
{
	var values = {'c':'推荐','h':'热门','p':'图片','f':'幻灯','s':'滚动','j':'跳转','a':'特荐','b':'加粗'};
	if(checkselectId())
	{
		var input = checkselectId();
	}
	else
	{
		$.dialog.alert('请勾选ID记录!'); return false;
	}
	var url = '{:U('Archive/ajax?method=flag')}'+ method;
	if(method=='add') {var methodname = '添加';}else{var methodname = '删除';}
	$.dialog.flag('请选择'+methodname+'属性操作',function(){},input,values,url);
}
/**
 * flag选择
 * @param	{String}	提示内容
 * @param	{Function}	回调函数. 接收参数：输入值
 * @param	{string}    被选中的id
 * @param	{array}     默认的值和描述
 * @param	{string}    ajax提交地址
 * @param	{string}    ajax提交方法,add 增加属性, del 删除属性
 */
artDialog.flag = function (content,yes,input,value,url) {
	var option ='';
	for(var key in value)
	{
		option += value[key] + '<input value="'+ key +'" name="flag" class="noborder" type="radio"/>';
	}
    var input;
    
    return artDialog({
		title:'批量操作',
        id: 'select',
        fixed: true,
        lock: true,
        opacity: .1,
        content: [
            '<div style="margin-bottom:5px;font-size:12px" id="art_content">',
                '<font>批量处理ID值</font>',
            '</div>',
            '<div>',
                '<input value="',
                    input,
                '" style="width:18em;padding:6px 4px" name="art_ids" id="art_ids"/><br/>',
				'<div style="margin-bottom:5px;margin-top:5px;font-size:12px">',
                content,
            '</div>',
            option,
            '</div>',
            ].join(''),
        init: function () {
		
        },
        ok: function (here) {
			if($('#art_ids').val()=='')
			{
				$('#art_content > font').attr('color','red');
				this.shake && this.shake();// 调用抖动接口
				return false;
			}
			//ajax提交
			var ajax_ids = $('#art_ids').val();
			var ajax_flag ='';
			$("input[name='flag']").each(function(){
				if($(this).attr('checked')=='checked') ajax_flag =$(this).val();
			});
			$.ajax({
			type: "POST",
			url: url,
			data: "id="+ajax_ids+"&flag="+ajax_flag,
			success: function(msg){
					//$.dialog.tips('操作成功!即将重载页面~~~');
					//setTimeout("window.location.reload(true)",2000);
					window.location.reload(true);
					}
				});
        },
        cancel: true
    });
};
/**
 * flag属性选择
 * @param	{String}	提示内容
 * @param	{Function}	回调函数. 接收参数：输入值
 * @param	{string}    被选中的id
 * @param	{array}     默认的值和描述
 * @param	{string}    ajax提交地址
 */
artDialog.select = function (content,yes,input,value,url) {
	var option ='';
	for(var key in value)
	{
		option += '<option value="'+ key +'" id="art_select_"'+ key +'>'+ value[key] +'</option>';
	}
    var input;
    
    return artDialog({
		title:'批量操作',
        id: 'flag',
        fixed: true,
        lock: true,
        opacity: .1,
        content: [
            '<div style="margin-bottom:5px;font-size:12px" id="art_content">',
                '批量处理ID值',
            '</div>',
            '<div>',
                '<input value="',
                    input,
                '" style="width:18em;padding:6px 4px" name="art_ids" id="art_ids"/><br/>',
				'<div style="margin-bottom:5px;margin-top:5px;font-size:12px">',
                content,
            '</div>',
            '<select name="select" id="art_select" style="padding:6px 4px">',
                    option,
                '</select>',
            '</div>',
			'<div id="art_show_money"><div style="margin-bottom:5px;margin-top:5px;font-size:12px">',
                '付费浏览金额',
            '</div>',
			'<input value="',
                    20,
                '" style="width:18em;padding:6px 4px" name="art_money" id="art_money"/></div>',
            ].join(''),
        init: function () {
		
        },
        ok: function (here) {
			if($('#art_ids').val()=='')
			{
				$('#art_content > font').attr('color','red');
				this.shake && this.shake();// 调用抖动接口
				return false;
			}
			//ajax提交
			var ajax_ids = $('#art_ids').val();
			var ajax_select = $('#art_select').val();
			var ajax_money = $('#art_money').val();
			$.ajax({
			type: "POST",
			url: url,
			data: "id="+ajax_ids+"&arcrank="+ajax_select+"&money="+ajax_money+"&method=",
			success: function(msg){
				// $.dialog.tips('操作成功!即将重载页面~~~');
				// setTimeout("window.location.reload(true)",2000);
					window.location.reload(true);
					}
				});
        },
        cancel: true
    });
};
</script>
</head>
<body>
    <form name="myform" id="myform" method="POST" onsubmit="return checkselectId()" action="{:U('Guestbook/delall')}">
<table width="95%" border="0"  align="center" cellpadding="3" cellspacing="1" bgcolor="#F2F9E8" class="admintable">
<tr> 
<td colspan="10" align="left" class="admintitle"><h6>留言管理</h6></td></tr>
    <tr bgcolor="#f1f3f5" style="font-weight:bold;">
    <td width="5%" height="30" align="center" class="ButtonList">ID</td>
    <td width="5%" height="30" align="center" class="ButtonList">选择</td>
    <td width="" align="center" class="ButtonList">留言内容</td>
    <td width="8%" height="25" align="center" class="ButtonList">更新时间</td>
    <td width="5%" height="25" align="center" class="ButtonList">联系人</td>
    <td width="8%" height="25" align="center" class="ButtonList">联系电话</td>
    <td width="7%" height="25" align="center" class="ButtonList">Email</td>        
    <td width="5%" height="25" align="center" class="ButtonList">审核</td>
    <td width="7%" height="25" align="center" class="ButtonList">回复</td>
    <td width="7%" height="25" align="center" class="ButtonList">操作</td>    
    </tr>
    <volist name="list" id="vo"> 
    <tr bgcolor="#ffffff" onMouseOver="this.style.backgroundColor='#EAFCD5';" onMouseOut="this.style.backgroundColor='';this.style.color=''">
	<td height="25" align="CENTER">{$vo.id}</td>
    <td height="25" align="CENTER"><input type="checkbox" class='ids' value="{$vo.id}" name="id[]" onClick="unselectall(this.form)" style="border:0;"></td>
    <td height="25"><a href="{$vo.id|url='view',###}" target='_blank'><notempty name="vo.color"><font color="{$vo.color}">{$vo.content}</font><else/>{$vo.content}</notempty></a><notempty name="vo.flag">[<font color="red"></notempty>{$vo.flag|parseflag=###}<notempty name="vo.flag"></font>]</notempty></td>
    <td height="25" align="center">{$vo.pubdate|date="Y-m-d",###}</td>
    <td height="25" align="center">{$vo.name}</td>
    <td height="25" align="center">{$vo.qq}</td>
    <td height="25" align="center">{$vo.email}</td>
    <td height="25" align="center"><eq name="vo.display" value='0'>显示<else/>隐藏</eq></td>
    <td height="25" align="center">{$vo.other}</td>
    <td align="center">
	<a onclick="singleaudit('{$vo.id}')">
	<switch name="vo.arcrank" >
	<case value="1"><font color="green">正常浏览</font></case>
	<case value="2"><font color="blue">会员浏览</font></case>
	<case value="3"><font color="#c33E5">付费浏览</font></case>
	<case value="4"><font color="red">禁止浏览</font></case>
	<case value="8"><font color="green">还原文档</font></case>
	</switch>
	</a><a href="{:U('Guestbook/edit?id=')}{$vo.id}">更改</a>|<a href="javascript:;" onClick="JavaScript:return jconfirm('确定要删除？','{:U('Guestbook/del?id=')}{$vo.id}&method=truedel</eq>')">删除</a></td>
    
	</tr>
	</volist>
    <tr>
 <td height="25" align="center" bgcolor="f7f7f7">全选</td>
<td align="center" bgcolor="f7f7f7">
<input name="Action" type="hidden"  value="Del">
<input name="chkAll" type="checkbox" id="chkAll" onClick="CheckAll(this.form)" value="checkbox" style="border:0">
</td>
  <td colspan="6" bgcolor="f7f7f7" align="left">
    &nbsp;
<input name="Del" type="submit" class="bnt" id="Del" value="删除">
<input name="Del" type="submit" class="bnt" id="Del" value="显示">
<input name="Del" type="submit" class="bnt" id="Del" value="隐藏">
</td>
</tr>
    <tr>
<td colspan="8" bgcolor="f7f7f7">
<div id="page">
	<ul>
{$page}
    </ul>
</div>
</td>
</tr>
</table>
</form>

<div style="text-align:center;margin:10px;">
<hr>
<include file="Index:copy" /> 
</div>
</body>
</html>